package imgshare.model;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * notification
 * @author 
 */
public class Notification implements Serializable {
    private Integer id;

    /**
     * 通知类型
     */
    private String type;

    @NotBlank(message = "正文不能为空")
    private String content;

    private LocalDateTime createdTime;

    private Boolean beRead;

    /**
     * 接受通知的用户id
     */
    private Integer receiverId;

    /**
     * 关联用户id，类型为新关注时为关注关系中主体id，类型为new_post时为资源创建者id
     */
    private Integer relatedUserId;

    /**
     * type为new_post时关联资源id
     */
    private Integer relatedResourceId;

    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        return "Notification{" +
                "id=" + id +
                ", type='" + type + '\'' +
                ", content='" + content + '\'' +
                ", createdTime=" + createdTime +
                ", beRead=" + beRead +
                ", receiverId=" + receiverId +
                ", relatedUserId=" + relatedUserId +
                ", relatedResourceId=" + relatedResourceId +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public Boolean getBeRead() {
        return beRead;
    }

    public void setBeRead(Boolean beRead) {
        this.beRead = beRead;
    }

    public Integer getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(Integer receiverId) {
        this.receiverId = receiverId;
    }

    public Integer getRelatedUserId() {
        return relatedUserId;
    }

    public void setRelatedUserId(Integer relatedUserId) {
        this.relatedUserId = relatedUserId;
    }

    public Integer getRelatedResourceId() {
        return relatedResourceId;
    }

    public void setRelatedResourceId(Integer relatedResourceId) {
        this.relatedResourceId = relatedResourceId;
    }
}